
; PicBasic Pro Compiler 2.46, (c) 1998, 2005 microEngineering Labs, Inc. All Rights Reserved.  
_USED			EQU	1

	INCLUDE	"C:\PBP\18F8722.INC"


; Define statements.
#define		OSC		     40 
#define		LCD_DREG		    PORTH
#define		LCD_DBIT		    4
#define		LCD_RSREG		   PORTH
#define		LCD_RSBIT		   1
#define		LCD_EREG		    PORTH
#define		LCD_EBIT		    3
#define		LCD_BITS		    4
#define		LCD_LINES		   2 
#define		LCD_RWREG		 PORTH       
#define		LCD_RWBIT		   2         

RAM_START       		EQU	00000h
RAM_END         		EQU	00F5Fh
RAM_BANKS       		EQU	00010h
BANK0_START     		EQU	00060h
BANK0_END       		EQU	000FFh
BANK1_START     		EQU	00100h
BANK1_END       		EQU	001FFh
BANK2_START     		EQU	00200h
BANK2_END       		EQU	002FFh
BANK3_START     		EQU	00300h
BANK3_END       		EQU	003FFh
BANK4_START     		EQU	00400h
BANK4_END       		EQU	004FFh
BANK5_START     		EQU	00500h
BANK5_END       		EQU	005FFh
BANK6_START     		EQU	00600h
BANK6_END       		EQU	006FFh
BANK7_START     		EQU	00700h
BANK7_END       		EQU	007FFh
BANK8_START     		EQU	00800h
BANK8_END       		EQU	008FFh
BANK9_START     		EQU	00900h
BANK9_END       		EQU	009FFh
BANK10_START    		EQU	00A00h
BANK10_END      		EQU	00AFFh
BANK11_START    		EQU	00B00h
BANK11_END      		EQU	00BFFh
BANK12_START    		EQU	00C00h
BANK12_END      		EQU	00CFFh
BANK13_START    		EQU	00D00h
BANK13_END      		EQU	00DFFh
BANK14_START    		EQU	00E00h
BANK14_END      		EQU	00EFFh
BANK15_START    		EQU	00F00h
BANK15_END      		EQU	00F5Fh
BANKA_START     		EQU	00000h
BANKA_END       		EQU	0005Fh

R0              		EQU	RAM_START + 000h
R1              		EQU	RAM_START + 002h
R2              		EQU	RAM_START + 004h
R3              		EQU	RAM_START + 006h
R4              		EQU	RAM_START + 008h
R5              		EQU	RAM_START + 00Ah
R6              		EQU	RAM_START + 00Ch
R7              		EQU	RAM_START + 00Eh
R8              		EQU	RAM_START + 010h
FLAGS           		EQU	RAM_START + 012h
GOP             		EQU	RAM_START + 013h
RM1             		EQU	RAM_START + 014h
RM2             		EQU	RAM_START + 015h
RR1             		EQU	RAM_START + 016h
RR2             		EQU	RAM_START + 017h
RS1             		EQU	RAM_START + 018h
RS2             		EQU	RAM_START + 019h
_B0              		EQU	RAM_START + 01Ah
_B1              		EQU	RAM_START + 01Bh
_Comd            		EQU	RAM_START + 01Ch
_Dat             		EQU	RAM_START + 01Dh
_Temp            		EQU	RAM_START + 01Eh
_PORTL           		EQU	 PORTB
_TRISL           		EQU	 TRISB
#define _TX1             	_PORTC_6
#define _RX1             	_PORTC_7
#define _TX2             	_PORTG_1
#define _RX2             	_PORTG_2
#define _RS              	_PORTH_1
#define _RW              	_PORTH_2
#define _EN              	_PORTH_3
#define _PORTC_6         	 PORTC, 006h
#define _PORTC_7         	 PORTC, 007h
#define _PORTG_1         	 PORTG, 001h
#define _PORTG_2         	 PORTG, 002h
#define _PORTH_1         	 PORTH, 001h
#define _PORTH_2         	 PORTH, 002h
#define _PORTH_3         	 PORTH, 003h
#define _B0_0            	_B0, 000h
#define _Temp_3          	_Temp, 003h

; Constants.
_T2400           		EQU	00000h
_T1200           		EQU	00001h
_T9600           		EQU	00002h
_T300            		EQU	00003h
_N2400           		EQU	00004h
_N1200           		EQU	00005h
_N9600           		EQU	00006h
_N300            		EQU	00007h
_OT2400          		EQU	00008h
_OT1200          		EQU	00009h
_OT9600          		EQU	0000Ah
_OT300           		EQU	0000Bh
_ON2400          		EQU	0000Ch
_ON1200          		EQU	0000Dh
_ON9600          		EQU	0000Eh
_ON300           		EQU	0000Fh
_MSBPRE          		EQU	00000h
_LSBPRE          		EQU	00001h
_MSBPOST         		EQU	00002h
_LSBPOST         		EQU	00003h
_LSBFIRST        		EQU	00000h
_MSBFIRST        		EQU	00001h
_CLS             		EQU	00000h
_HOME            		EQU	00001h
_BELL            		EQU	00007h
_BKSP            		EQU	00008h
_TAB             		EQU	00009h
_CR              		EQU	0000Dh
_UnitOn          		EQU	00012h
_UnitOff         		EQU	0001Ah
_UnitsOff        		EQU	0001Ch
_LightsOn        		EQU	00014h
_LightsOff       		EQU	00010h
_Dim             		EQU	0001Eh
_Bright          		EQU	00016h
_Baud            		EQU	00054h
	INCLUDE	"TEST_B~1.MAC"
	INCLUDE	"C:\PBP\PBPPIC18.LIB"


	ASM?
_PORTH	EQU     PORTC

	ENDASM?


	ASM?
_TRISH	EQU	TRISC

	ENDASM?

	LOW?T	_RW
	SEROUT2DPIN?T	_TX1
	SEROUT2MODE?C	_Baud
	SEROUT2PACE?C	000h
	SEROUT2?C	00Ch
	SEROUT2?C	020h
	SEROUT2?C	054h
	SEROUT2?C	065h
	SEROUT2?C	073h
	SEROUT2?C	074h
	SEROUT2?C	020h
	SEROUT2?C	045h
	SEROUT2?C	054h
	SEROUT2?C	02Dh
	SEROUT2?C	042h
	SEROUT2?C	041h
	SEROUT2?C	053h
	SEROUT2?C	045h
	SEROUT2?C	020h
	SEROUT2?C	031h
	SEROUT2?C	038h
	SEROUT2?C	046h
	SEROUT2?C	038h
	SEROUT2?C	037h
	SEROUT2?C	032h
	SEROUT2?C	032h
	SEROUT2?C	00Ah
	SEROUT2?C	00Dh
	SEROUT2DPIN?T	_TX1
	SEROUT2MODE?C	_Baud
	SEROUT2PACE?C	000h
	SEROUT2?C	020h
	SEROUT2?C	054h
	SEROUT2?C	065h
	SEROUT2?C	073h
	SEROUT2?C	074h
	SEROUT2?C	065h
	SEROUT2?C	064h
	SEROUT2?C	020h
	SEROUT2?C	042h
	SEROUT2?C	079h
	SEROUT2?C	020h
	SEROUT2?C	057h
	SEROUT2?C	041h
	SEROUT2?C	054h
	SEROUT2?C	043h
	SEROUT2?C	048h
	SEROUT2?C	041h
	SEROUT2?C	052h
	SEROUT2?C	049h
	SEROUT2?C	04Eh
	SEROUT2?C	00Ah
	SEROUT2?C	00Dh
	SEROUT2DPIN?T	_TX1
	SEROUT2MODE?C	_Baud
	SEROUT2PACE?C	000h
	SEROUT2?C	020h
	SEROUT2?C	050h
	SEROUT2?C	06Ch
	SEROUT2?C	065h
	SEROUT2?C	061h
	SEROUT2?C	073h
	SEROUT2?C	065h
	SEROUT2?C	020h
	SEROUT2?C	053h
	SEROUT2?C	065h
	SEROUT2?C	06Ch
	SEROUT2?C	065h
	SEROUT2?C	063h
	SEROUT2?C	074h
	SEROUT2?C	020h
	SEROUT2?C	066h
	SEROUT2?C	06Fh
	SEROUT2?C	06Ch
	SEROUT2?C	06Ch
	SEROUT2?C	06Fh
	SEROUT2?C	077h
	SEROUT2?C	069h
	SEROUT2?C	06Eh
	SEROUT2?C	067h
	SEROUT2?C	020h
	SEROUT2?C	063h
	SEROUT2?C	068h
	SEROUT2?C	06Fh
	SEROUT2?C	069h
	SEROUT2?C	063h
	SEROUT2?C	065h
	SEROUT2?C	020h
	SEROUT2?C	066h
	SEROUT2?C	06Fh
	SEROUT2?C	072h
	SEROUT2?C	020h
	SEROUT2?C	054h
	SEROUT2?C	065h
	SEROUT2?C	073h
	SEROUT2?C	074h
	SEROUT2?C	020h
	SEROUT2?C	00Ah
	SEROUT2?C	00Dh
	SEROUT2?C	00Ah
	SEROUT2?C	00Dh
	SEROUT2DPIN?T	_TX1
	SEROUT2MODE?C	_Baud
	SEROUT2PACE?C	000h
	SEROUT2?C	031h
	SEROUT2?C	02Eh
	SEROUT2?C	054h
	SEROUT2?C	065h
	SEROUT2?C	073h
	SEROUT2?C	074h
	SEROUT2?C	020h
	SEROUT2?C	049h
	SEROUT2?C	02Fh
	SEROUT2?C	04Fh
	SEROUT2?C	00Ah
	SEROUT2?C	00Dh
	SEROUT2DPIN?T	_TX1
	SEROUT2MODE?C	_Baud
	SEROUT2PACE?C	000h
	SEROUT2?C	032h
	SEROUT2?C	02Eh
	SEROUT2?C	054h
	SEROUT2?C	065h
	SEROUT2?C	073h
	SEROUT2?C	074h
	SEROUT2?C	020h
	SEROUT2?C	052h
	SEROUT2?C	053h
	SEROUT2?C	032h
	SEROUT2?C	033h
	SEROUT2?C	032h
	SEROUT2?C	02Dh
	SEROUT2?C	031h
	SEROUT2?C	00Ah
	SEROUT2?C	00Dh
	SEROUT2DPIN?T	_TX1
	SEROUT2MODE?C	_Baud
	SEROUT2PACE?C	000h
	SEROUT2?C	033h
	SEROUT2?C	02Eh
	SEROUT2?C	054h
	SEROUT2?C	065h
	SEROUT2?C	073h
	SEROUT2?C	074h
	SEROUT2?C	020h
	SEROUT2?C	052h
	SEROUT2?C	053h
	SEROUT2?C	032h
	SEROUT2?C	033h
	SEROUT2?C	032h
	SEROUT2?C	02Dh
	SEROUT2?C	032h
	SEROUT2?C	00Ah
	SEROUT2?C	00Dh
	SEROUT2DPIN?T	_TX1
	SEROUT2MODE?C	_Baud
	SEROUT2PACE?C	000h
	SEROUT2?C	034h
	SEROUT2?C	02Eh
	SEROUT2?C	054h
	SEROUT2?C	065h
	SEROUT2?C	073h
	SEROUT2?C	074h
	SEROUT2?C	020h
	SEROUT2?C	04Ch
	SEROUT2?C	043h
	SEROUT2?C	044h
	SEROUT2?C	00Ah
	SEROUT2?C	00Dh
	SERIN2DPIN?T	_RX1
	SERIN2MODE?C	_Baud
	SERIN2?B	_Dat
	CMPEQ?BCL	_Dat, 031h, _Test_IO
	CMPEQ?BCL	_Dat, 032h, _Test_RS232_1
	CMPEQ?BCL	_Dat, 033h, _Test_RS232_2
	CMPEQ?BCL	_Dat, 034h, _Test_LCD

	LABEL?L	_Test_IO	
	MOVE?CB	0FFh, LATA
	MOVE?CB	0FFh, LATB
	MOVE?CB	0FFh, LATC
	MOVE?CB	0FFh, LATD
	MOVE?CB	0FFh, LATE
	MOVE?CB	0FFh, LATF
	MOVE?CB	0FFh, LATG
	MOVE?CB	0FFh, LATH
	MOVE?CB	0FFh, LATJ
	MOVE?CB	000h, TRISA
	MOVE?CB	000h, TRISB
	MOVE?CB	000h, TRISC
	MOVE?CB	000h, TRISD
	MOVE?CB	000h, TRISE
	MOVE?CB	000h, TRISF
	MOVE?CB	000h, TRISG
	MOVE?CB	000h, TRISH
	MOVE?CB	000h, TRISJ
	MOVE?CB	00Fh, ADCON1
	MOVE?CB	007h, CMCON
	MOVE?CB	0FFh, PORTA
	MOVE?CB	0FFh, PORTB
	MOVE?CB	0FFh, PORTC
	MOVE?CB	0FFh, PORTD
	MOVE?CB	0FFh, PORTE
	MOVE?CB	0FFh, PORTF
	MOVE?CB	0FFh, PORTG
	MOVE?CB	0FFh, PORTH
	MOVE?CB	0FFh, PORTJ
	SEROUT2DPIN?T	_TX1
	SEROUT2MODE?C	_Baud
	SEROUT2PACE?C	000h
	SEROUT2?C	00Ch
	SEROUT2?C	054h
	SEROUT2?C	065h
	SEROUT2?C	073h
	SEROUT2?C	074h
	SEROUT2?C	020h
	SEROUT2?C	049h
	SEROUT2?C	02Fh
	SEROUT2?C	04Fh
	SEROUT2?C	00Ah
	SEROUT2?C	00Dh

	LABEL?L	_start_IO	
	MOVE?CB	0FEh, _B0
	MOVE?CB	000h, _B1
	LABEL?L	L00001	
	CMPGT?BCL	_B1, 008h, L00002
	MOVE?BB	_B0, PORTA
	SHIFTL?BCB	_B0, 001h, _B0
	MOVE?CT	001h, _B0_0
	PAUSE?C	001F4h
	NEXT?BCL	_B1, 001h, L00001
	LABEL?L	L00002	
	MOVE?CB	0FEh, _B0
	MOVE?CB	000h, _B1
	LABEL?L	L00003	
	CMPGT?BCL	_B1, 008h, L00004
	MOVE?BB	_B0, PORTB
	SHIFTL?BCB	_B0, 001h, _B0
	MOVE?CT	001h, _B0_0
	PAUSE?C	001F4h
	NEXT?BCL	_B1, 001h, L00003
	LABEL?L	L00004	
	MOVE?CB	0FEh, _B0
	MOVE?CB	000h, _B1
	LABEL?L	L00005	
	CMPGT?BCL	_B1, 008h, L00006
	MOVE?BB	_B0, PORTC
	SHIFTL?BCB	_B0, 001h, _B0
	MOVE?CT	001h, _B0_0
	PAUSE?C	001F4h
	NEXT?BCL	_B1, 001h, L00005
	LABEL?L	L00006	
	MOVE?CB	0FEh, _B0
	MOVE?CB	000h, _B1
	LABEL?L	L00007	
	CMPGT?BCL	_B1, 008h, L00008
	MOVE?BB	_B0, PORTD
	SHIFTL?BCB	_B0, 001h, _B0
	MOVE?CT	001h, _B0_0
	PAUSE?C	001F4h
	NEXT?BCL	_B1, 001h, L00007
	LABEL?L	L00008	
	MOVE?CB	0FEh, _B0
	MOVE?CB	000h, _B1
	LABEL?L	L00009	
	CMPGT?BCL	_B1, 008h, L00010
	MOVE?BB	_B0, PORTE
	SHIFTL?BCB	_B0, 001h, _B0
	MOVE?CT	001h, _B0_0
	PAUSE?C	001F4h
	NEXT?BCL	_B1, 001h, L00009
	LABEL?L	L00010	
	MOVE?CB	0FEh, _B0
	MOVE?CB	000h, _B1
	LABEL?L	L00011	
	CMPGT?BCL	_B1, 008h, L00012
	MOVE?BB	_B0, PORTF
	SHIFTL?BCB	_B0, 001h, _B0
	MOVE?CT	001h, _B0_0
	PAUSE?C	001F4h
	NEXT?BCL	_B1, 001h, L00011
	LABEL?L	L00012	
	MOVE?CB	0FEh, _B0
	MOVE?CB	000h, _B1
	LABEL?L	L00013	
	CMPGT?BCL	_B1, 008h, L00014
	MOVE?BB	_B0, PORTG
	SHIFTL?BCB	_B0, 001h, _B0
	MOVE?CT	001h, _B0_0
	PAUSE?C	001F4h
	NEXT?BCL	_B1, 001h, L00013
	LABEL?L	L00014	
	MOVE?CB	0FEh, _B0
	MOVE?CB	000h, _B1
	LABEL?L	L00015	
	CMPGT?BCL	_B1, 008h, L00016
	MOVE?BB	_B0, PORTH
	SHIFTL?BCB	_B0, 001h, _B0
	MOVE?CT	001h, _B0_0
	PAUSE?C	001F4h
	NEXT?BCL	_B1, 001h, L00015
	LABEL?L	L00016	
	MOVE?CB	0FEh, _B0
	MOVE?CB	000h, _B1
	LABEL?L	L00017	
	CMPGT?BCL	_B1, 008h, L00018
	MOVE?BB	_B0, PORTJ
	SHIFTL?BCB	_B0, 001h, _B0
	MOVE?CT	001h, _B0_0
	PAUSE?C	001F4h
	NEXT?BCL	_B1, 001h, L00017
	LABEL?L	L00018	
	GOTO?L	_start_IO

	LABEL?L	_Test_RS232_1	
	SEROUT2DPIN?T	_TX1
	SEROUT2MODE?C	_Baud
	SEROUT2PACE?C	000h
	SEROUT2?C	00Ch
	SEROUT2?C	020h
	SEROUT2?C	054h
	SEROUT2?C	065h
	SEROUT2?C	073h
	SEROUT2?C	074h
	SEROUT2?C	020h
	SEROUT2?C	052h
	SEROUT2?C	053h
	SEROUT2?C	032h
	SEROUT2?C	033h
	SEROUT2?C	032h
	SEROUT2?C	020h
	SEROUT2?C	043h
	SEROUT2?C	068h
	SEROUT2?C	065h
	SEROUT2?C	06Eh
	SEROUT2?C	061h
	SEROUT2?C	06Ch
	SEROUT2?C	020h
	SEROUT2?C	031h
	SEROUT2?C	00Ah
	SEROUT2?C	00Dh
	SEROUT2?C	050h
	SEROUT2?C	06Ch
	SEROUT2?C	065h
	SEROUT2?C	061h
	SEROUT2?C	073h
	SEROUT2?C	065h
	SEROUT2?C	020h
	SEROUT2?C	061h
	SEROUT2?C	06Eh
	SEROUT2?C	079h
	SEROUT2?C	020h
	SEROUT2?C	06Bh
	SEROUT2?C	065h
	SEROUT2?C	079h
	SEROUT2?C	020h
	SEROUT2?C	074h
	SEROUT2?C	06Fh
	SEROUT2?C	020h
	SEROUT2?C	074h
	SEROUT2?C	065h
	SEROUT2?C	073h
	SEROUT2?C	074h
	SEROUT2?C	00Ah
	SEROUT2?C	00Dh

	LABEL?L	_RS_loop1	
	SERIN2DPIN?T	_RX1
	SERIN2MODE?C	_Baud
	SERIN2?B	_B0
	SEROUT2DPIN?T	_TX1
	SEROUT2MODE?C	_Baud
	SEROUT2PACE?C	000h
	SEROUT2?B	_B0
	GOTO?L	_RS_loop1

	LABEL?L	_Test_RS232_2	
	SEROUT2DPIN?T	_TX2
	SEROUT2MODE?C	_Baud
	SEROUT2PACE?C	000h
	SEROUT2?C	00Ch
	SEROUT2?C	020h
	SEROUT2?C	054h
	SEROUT2?C	065h
	SEROUT2?C	073h
	SEROUT2?C	074h
	SEROUT2?C	020h
	SEROUT2?C	052h
	SEROUT2?C	053h
	SEROUT2?C	032h
	SEROUT2?C	033h
	SEROUT2?C	032h
	SEROUT2?C	020h
	SEROUT2?C	043h
	SEROUT2?C	068h
	SEROUT2?C	065h
	SEROUT2?C	06Eh
	SEROUT2?C	061h
	SEROUT2?C	06Ch
	SEROUT2?C	020h
	SEROUT2?C	032h
	SEROUT2?C	00Ah
	SEROUT2?C	00Dh
	SEROUT2?C	050h
	SEROUT2?C	06Ch
	SEROUT2?C	065h
	SEROUT2?C	061h
	SEROUT2?C	073h
	SEROUT2?C	065h
	SEROUT2?C	020h
	SEROUT2?C	061h
	SEROUT2?C	06Eh
	SEROUT2?C	079h
	SEROUT2?C	020h
	SEROUT2?C	06Bh
	SEROUT2?C	065h
	SEROUT2?C	079h
	SEROUT2?C	020h
	SEROUT2?C	074h
	SEROUT2?C	06Fh
	SEROUT2?C	020h
	SEROUT2?C	074h
	SEROUT2?C	065h
	SEROUT2?C	073h
	SEROUT2?C	074h
	SEROUT2?C	00Ah
	SEROUT2?C	00Dh

	LABEL?L	_RS_loop2	
	SERIN2DPIN?T	_RX2
	SERIN2MODE?C	_Baud
	SERIN2?B	_B0
	SEROUT2DPIN?T	_TX2
	SEROUT2MODE?C	_Baud
	SEROUT2PACE?C	000h
	SEROUT2?B	_B0
	GOTO?L	_RS_loop2

	LABEL?L	_Test_LCD	
	MOVE?CB	00Fh, ADCON1
	SEROUT2DPIN?T	_TX1
	SEROUT2MODE?C	_Baud
	SEROUT2PACE?C	000h
	SEROUT2?C	00Ch
	SEROUT2?C	020h
	SEROUT2?C	054h
	SEROUT2?C	065h
	SEROUT2?C	073h
	SEROUT2?C	074h
	SEROUT2?C	020h
	SEROUT2?C	04Ch
	SEROUT2?C	043h
	SEROUT2?C	044h
	SEROUT2?C	020h
	SEROUT2?C	057h
	SEROUT2?C	069h
	SEROUT2?C	074h
	SEROUT2?C	068h
	SEROUT2?C	020h
	SEROUT2?C	045h
	SEROUT2?C	054h
	SEROUT2?C	02Dh
	SEROUT2?C	042h
	SEROUT2?C	041h
	SEROUT2?C	053h
	SEROUT2?C	045h
	SEROUT2?C	020h
	SEROUT2?C	038h
	SEROUT2?C	037h
	SEROUT2?C	032h
	SEROUT2?C	032h
	SEROUT2?C	00Ah
	SEROUT2?C	00Dh
	SEROUT2DPIN?T	_TX1
	SEROUT2MODE?C	_Baud
	SEROUT2PACE?C	000h
	SEROUT2?C	020h
	SEROUT2?C	059h
	SEROUT2?C	06Fh
	SEROUT2?C	075h
	SEROUT2?C	020h
	SEROUT2?C	077h
	SEROUT2?C	069h
	SEROUT2?C	06Ch
	SEROUT2?C	06Ch
	SEROUT2?C	020h
	SEROUT2?C	073h
	SEROUT2?C	065h
	SEROUT2?C	065h
	SEROUT2?C	020h
	SEROUT2?C	066h
	SEROUT2?C	06Fh
	SEROUT2?C	06Ch
	SEROUT2?C	06Ch
	SEROUT2?C	06Fh
	SEROUT2?C	077h
	SEROUT2?C	069h
	SEROUT2?C	06Eh
	SEROUT2?C	067h
	SEROUT2?C	020h
	SEROUT2?C	04Dh
	SEROUT2?C	061h
	SEROUT2?C	073h
	SEROUT2?C	073h
	SEROUT2?C	061h
	SEROUT2?C	067h
	SEROUT2?C	065h
	SEROUT2?C	020h
	SEROUT2?C	06Fh
	SEROUT2?C	06Eh
	SEROUT2?C	020h
	SEROUT2?C	04Ch
	SEROUT2?C	043h
	SEROUT2?C	044h
	SEROUT2?C	00Ah
	SEROUT2?C	00Dh
	SEROUT2?C	00Ah
	SEROUT2?C	00Dh
	SEROUT2DPIN?T	_TX1
	SEROUT2MODE?C	_Baud
	SEROUT2PACE?C	000h
	SEROUT2?C	020h
	SEROUT2?C	020h
	SEROUT2?C	020h
	SEROUT2?C	020h
	SEROUT2?C	054h
	SEROUT2?C	065h
	SEROUT2?C	073h
	SEROUT2?C	074h
	SEROUT2?C	020h
	SEROUT2?C	04Ch
	SEROUT2?C	043h
	SEROUT2?C	044h
	SEROUT2?C	020h
	SEROUT2?C	031h
	SEROUT2?C	038h
	SEROUT2?C	046h
	SEROUT2?C	038h
	SEROUT2?C	037h
	SEROUT2?C	032h
	SEROUT2?C	030h
	SEROUT2?C	00Ah
	SEROUT2?C	00Dh
	SEROUT2DPIN?T	_TX1
	SEROUT2MODE?C	_Baud
	SEROUT2PACE?C	000h
	SEROUT2?C	020h
	SEROUT2?C	020h
	SEROUT2?C	020h
	SEROUT2?C	020h
	SEROUT2?C	020h
	SEROUT2?C	020h
	SEROUT2?C	045h
	SEROUT2?C	054h
	SEROUT2?C	054h
	SEROUT2?C	020h
	SEROUT2?C	043h
	SEROUT2?C	04Fh
	SEROUT2?C	02Eh
	SEROUT2?C	02Ch
	SEROUT2?C	04Ch
	SEROUT2?C	054h
	SEROUT2?C	044h
	SEROUT2?C	00Ah
	SEROUT2?C	00Dh
	GOSUB?L	_Init_LCD

	LABEL?L	_stop_LCD	
	LCDOUT?C	0FEh
	LCDOUT?C	001h
	LCDOUT?C	054h
	LCDOUT?C	065h
	LCDOUT?C	073h
	LCDOUT?C	074h
	LCDOUT?C	020h
	LCDOUT?C	04Ch
	LCDOUT?C	043h
	LCDOUT?C	044h
	LCDOUT?C	020h
	LCDOUT?C	031h
	LCDOUT?C	038h
	LCDOUT?C	046h
	LCDOUT?C	038h
	LCDOUT?C	037h
	LCDOUT?C	032h
	LCDOUT?C	032h
	PAUSE?C	003E8h
	LCDOUT?C	0FEh
	LCDOUT?C	0C0h
	LCDOUT?C	020h
	LCDOUT?C	045h
	LCDOUT?C	054h
	LCDOUT?C	054h
	LCDOUT?C	020h
	LCDOUT?C	043h
	LCDOUT?C	04Fh
	LCDOUT?C	02Eh
	LCDOUT?C	02Ch
	LCDOUT?C	04Ch
	LCDOUT?C	054h
	LCDOUT?C	044h
	PAUSE?C	003E8h
	GOTO?L	_stop_LCD

	LABEL?L	_Init_LCD	
	MOVE?CB	000h, TRISH
	MOVE?CB	00Fh, ADCON1
	MOVE?CB	007h, CMCON
	MOVE?CT	000h, _RW
	MOVE?CB	033h, _Comd
	GOSUB?L	_Write_CMD
	MOVE?CB	032h, _Comd
	GOSUB?L	_Write_CMD
	MOVE?CB	028h, _Comd
	GOSUB?L	_Write_CMD
	MOVE?CB	00Ch, _Comd
	GOSUB?L	_Write_CMD
	MOVE?CB	006h, _Comd
	GOSUB?L	_Write_CMD
	MOVE?CB	001h, _Comd
	GOSUB?L	_Write_CMD
	MOVE?CB	001h, _Comd
	GOSUB?L	_Write_CMD
	RETURN?	

	LABEL?L	_Write_CMD	
	LOW?T	_RS
	AND?BCB	_Comd, 0F0h, _Temp
	MOVE?CT	001h, _Temp_3
	MOVE?BB	_Temp, PORTH
	LOW?T	_EN
	PAUSE?C	00Ah
	HIGH?T	_EN
	SHIFTL?BCB	_Comd, 004h, _Temp
	AND?BCB	_Temp, 0F0h, _Temp
	MOVE?CT	001h, _Temp_3
	MOVE?BB	_Temp, PORTH
	LOW?T	_EN
	PAUSE?C	00Ah
	HIGH?T	_EN
	PAUSE?C	00Ah
	RETURN?	

	END
